{% extends "base.html" %}

{% block title %}{{ todo.title }} - 详情{% endblock %}

{% block content %}
<div class="detail-header">
    <a href="{{ url_for('index') }}" class="back-btn">
        <i class="fas fa-arrow-left"></i> 返回
    </a>
    <div class="header-actions">
        <form action="{{ url_for('delete_todo_web', todo_id=todo.id) }}" method="POST" style="display: inline;">
            <button type="submit" class="btn btn-danger" onclick="return confirm('确定要删除吗？')">
                <i class="fas fa-trash"></i> 删除
            </button>
        </form>
    </div>
</div>

<div class="todo-detail">
    <div class="detail-card">
        <div class="detail-status {% if todo.completed %}completed{% endif %}">
            <i class="fas fa-{% if todo.completed %}check-circle{% else %}circle{% endif %}"></i>
            {{ '已完成' if todo.completed else '进行中' }}
        </div>
        
        <h1 class="detail-title">{{ todo.title }}</h1>
        
        {% if todo.description %}
        <div class="detail-description">
            <h3>描述</h3>
            <p>{{ todo.description }}</p>
        </div>
        {% endif %}
        
        <div class="detail-meta">
            <div class="meta-item">
                <i class="fas fa-calendar"></i>
                <span>创建时间: {{ todo.created_at }}</span>
            </div>
            <div class="meta-item">
                <i class="fas fa-id-card"></i>
                <span>ID: {{ todo.id }}</span>
            </div>
        </div>
    </div>
</div>
{% endblock %}